home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: SUN C Single key entry with no CR reqd
- Date: 12 Mar 1996 12:28:35 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4i4mpjINNqas@keats.ugrad.cs.ubc.ca>
- References: <4i1hr6$asm@ni1.ni.net> <4i434a$8nu@dawn.mmm.com>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4i434a$8nu@dawn.mmm.com>, Kevin J Hopps <kjhopps@mmm.com> wrote:
- >Ed Thomson (ethomson@cinahl.com) wrote:
- >> I am new to SUN C and was wondering how to issue a statement like
- >> getchar or getc but not require the user to press return after hitting
- >> the key.
- >
- >It's somewhat complicated, actually. The problem is that normally
- >keyboard input is line buffered. The terminal driver handles the
- >characters and the backspaces and makes the entire line available
- >to the application when a newline is entered.
- >
- >If you want to learn more about input processing from a keyboard,
- >run "man termio" -- that's a start.
-
- You don't have to go into that.
-
- #include <curses.h>
-
- int main()
- {
- int c;
-
- initscr();
- cbreak();
- nonl();
- noecho();
-
- c = getch();
-
- endwin();
-
- return 0;
- }
-
- But that is severely off topic for this newsgroup. The proper place is
- comp.unix.programmer.
- --
-
-